#!/usr/bin/python
# -*- coding:utf-8 -*-
# @FileName : test5_2.py
# Author    : myh

# 练习 5.2：更多条件测试　你并非只能创建 10 个条件测试。如果想尝
# 试做更多的比较，可再编写一些条件测试，并将它们加入
# conditional_tests.py。对于下面列出的各种情况，至少编写两个条件测
# 试，结果分别为 True 和 False。

# 检查两个字符串是否相等和不等。
car = 'subaru'
print("Is car == 'subaru'? I predict True.")
print(car == 'subaru')
print("\nIs car == 'audi'? I predict False.")
print(car == 'audi')


# 使用 lower() 方法的条件测试。
car1 = 'SuBarU'
print("Is car.lower() == 'subaru'? I predict True.")
print(car.lower() == 'subaru')
print("\nIs car.lower() == 'audi'? I predict False.")
print(car.lower() == 'audi')


# 涉及相等、不等、大于、小于、大于等于和小于等于的数值比较。
num1 = 1
print("\nIs num1>=1? I predict True.")
print(num1>=1)
print("\nIs num1<1? I predict False.")
print(num1<1)

num2 = 5
print("\nIs num2>4? I predict True.")
print(num2>4)
print("\nIs num2<=4? I predict False.")
print(num2<=4)

num3 = 10
print("\nIs num3 == 10? I predict True.")
print(num3 == 10)
print("\nIs num3 != 10? I predict False.")
print(num3 != 10)


# 使用关键字 and 和 or 的条件测试。
A1 = True
A2 = False
print("\nIs A1 or A2? I predict True.")
print(A1 or A2 )
print("\nIs A1 and A2? I predict False.")
print(A1 and A2)


# 测试特定的值是否在列表中。
# 测试特定的值是否不在列表中
num4 = 1
arr1 = [1,2,3,4,5,6]
print("\nIs num4 in arr1? I predict True.")
print(num4 in arr1 )
print("\nIs num4 not in arr1? I predict False.")
print(num4 not in arr1)
